#ifndef LOGUI_H
#define LOGUI_H
#include <QMouseEvent>
#include <QWidget>
#include <fstream>
#include <ostream>
#include<QDir>
#include"Structures.h"
#include<ctime>
#include"QGroupBox"
#include"user.h"

using namespace std;

class Log{
public:
    string filePath;
    //string tablename;//log的对象
public:
    void createLog(string file);
    void readLog();
    void writeLog(string message);
};

namespace Ui {
class LogUI;
}

class LogUI : public QWidget
{
    Q_OBJECT

public:
    explicit LogUI(QWidget *parent = nullptr);
    ~LogUI();
    void initLog();
    QGroupBox* addNew(QString time, QString instruction);
protected:
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
private slots:
    void on_pushButton_clicked();

private:
    Ui::LogUI *ui;
    QPoint mousePoint;
    bool mouse_press;
};

#endif // LOGUI_H
